package com.wanmait.translate.utils;

import com.wanmait.translate.dto.TypeContent;

/**
 * @Author huweibin
 * @Description EhCache的key
 * @Date 11:47 2020/11/23
 **/
public class RedisCacheMessage {
        //审核cache的名字
        public static final String AUDIT="auditCache";
    /*
     * @Author huweibin
     * @Description  根据审核类别获得key
     * @Date 13:01 2020/11/23
     **/
    public static final  String getAuditKey(TypeContent content, Integer state, String day){
        if(day.length()==10){
            day=day+" 00:00:00";
        }
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append("day:");
        stringBuilder.append(day);
        stringBuilder.append(":type:");
        stringBuilder.append(content.getType());
        stringBuilder.append(":typeName:");
        stringBuilder.append(content.getTypeName());
        stringBuilder.append(":state:");
        stringBuilder.append(state);
        return stringBuilder.toString();
    }
    public static final  String getAuditKey(AuditEnum auditEnum,Integer state, String day){
        if(day.length()==10){
            day=day+" 00:00:00";
        }
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append("day:");
        stringBuilder.append(day);
        stringBuilder.append(":type:");
        stringBuilder.append(auditEnum.getName());
        stringBuilder.append(":typeName:");
        stringBuilder.append(auditEnum.getTypeName());
        stringBuilder.append(":state:");
        stringBuilder.append(state);
        return stringBuilder.toString();
    }

}
